﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NaturalNote.Core.Database
{
    public class DbFactory
    {
        private DbFactory() {  }

        public static DbFactory Instance { get { return Nested.instance; } }

        private class Nested
        {
            //Explicit static constructor to tell C# compiler
            //not to mark type as beforefieldinit
            static Nested()
            {

            }

            internal static readonly DbFactory instance = new DbFactory();
        }        

        public IDb create(DbTrait trait, string connectionString) 
        {          
            return new Db(trait, connectionString);
        }
    }
}
